home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
auto_cad
/
vol2no3.lzh
/
DAT.LSP
next >
Wrap
Text File
|
1987-05-18
|
3KB
|
115 lines
; Datum Dimensioning by Charles Niesley
; 12/86
;
(defun hdraw (txtdim)
(command "line" (list (car pt2) (- (cadr pt2) A))
(list (car pt2) (- (cadr pt0b) B)))
(command)
(command "text" "r" (list (+ (car pt2) A) (- (cadr pt0b) C)) D 90 txtdim))_
(defun C:BOTTOM ()
(setvar "cmdecho" 0)
(setvar "highlight" 0)
(if (null scl) (setq scl (getvar "ltscale")))
(setq A (* scl 0.06)) ; dim line offset from selected point
(setq B (* scl 0.44)) ; dim line length from origin
(setq C (* scl 0.50)) ; text offset from origin
(setq D (* scl 0.125)) ; text height
(setq pt1 (getpoint "\nSelect origin, or press RETURN: "))
(if (/= pt1 nil) (progn (setq pt0b pt1) (setq pt2 pt0b)
(hdraw "0")))
(setq pt2 1)
(while pt2
(setq pt2 (getpoint "\nSelect next point: "))
(if (= (type pt2) 'list)
(hdraw (rtos (abs (- (car pt2) (car pt0b))) 2
(getvar "luprec")))
(setq pt2 nil))
)
(setvar "highlight" 1)
)
(defun vdraw (txtdim)
(command "line" (list (- (car pt2) A) (cadr pt2))
(list (- (car pt01) B) (cadr pt2)))
(command)
(command "text" "r" (list (- (car pt01) C) (- (cadr pt2)
A))
D 0 txtdim)
)
(defun C:LEFT ()
(setvar "cmdecho" 0)
(setvar "highlight" 0)
(if (null scl) (setq scl (getvar "ltscale")))
(setq A (* scl 0.06))
(setq B (* scl 0.44))
(setq C (* scl 0.50))
(setq D (* scl 0.125))
(setq pt1 (getpoint "\nSelect origin, or press RETURN: "))
(if (/= pt1 nil) (progn (setq pt01 pt1) (setq pt2 pt01)
(vdraw "0")))
(setq pt2 1)
(while pt2
(setq pt2 (getpoint "\nSelect next point: "))
(if (= (type pt2) 'list)
(vdraw (rtos (abs (- (cadr pt2) (cadr pt01))) 2
(getvar "luprec")))
(setq pt2 nil))
)
(setvar "highlight" 1)
)
(defun thdraw (txtdim)
(command "line" (list (car pt2) (+ (cadr pt2) A))
(list (car pt2) (+ (cadr pt0t) B)))
(command)
(command "text" (list (+ (car pt2) A) (+ (cadr pt0t) C)) D 90 txtdim)
)
(defun C:TOP ()
(setvar "cmdecho" 0)
(setvar "highlight" 0)
(if (null scl) (setq scl (getvar "ltscale")))
(setq A (* scl 0.06))
(setq B (* scl 0.44))
(setq C (* scl 0.44))
(setq D (* scl 0.125))
(setq pt1 (getpoint "\nSelect origin, or press RETURN: "))
(if (/= pt1 nil) (progn (setq pt0t pt1) (setq pt2 pt0t)
(thdraw "0")))
(setq pt2 1)
(while pt2
(setq pt2 (getpoint "\nSelect next point: "))
(if (= (type pt2) 'list)
(thdraw (rtos (abs (- (car pt2) (car pt0t))) 2
(getvar "luprec")))
(setq pt2 nil))
)
(setvar "highlight" 1)
)
(defun rvdraw (txtdim)
(command "line" (list (+ (car pt2) A) (cadr pt2))
(list (+ (car pt0r) B) (cadr pt2)))
(command)
(command "text" (list (+ (car pt0r) C) (- (cadr pt2) A))
D 0 txtdim)
)
(defun C:RIGHT ()
(setvar "cmdecho" 0)
(setvar "highlight" 0)
(if (null scl) (setq scl (getvar "ltscale")))
(setq A (* scl 0.06))
(setq B (* scl 0.44))
(setq C (* scl 0.50))
(setq D (* scl 0.125))
(setq pt1 (getpoint "\nSelect origin, or press RETURN: "))
(if (/= pt1 nil) (progn (setq pt0r pt1) (setq pt2 pt0r)
(rvdraw "0")))
(setq pt2 1)
(while pt2
(setq pt2 (getpoint "\nSelect next point: "))
(if (= (type pt2) 'list)
(rvdraw (rtos (abs (- (cadr pt2) (cadr pt0r))) 2
(getvar "luprec")))
(setq pt2 nil))
)
(setvar "highlight" 1)
)